#define _CRT_SECURE_NO_WARNINGS  1


class Solution {
public:
    vector<int> intersection(vector<int>& nums1, vector<int>& nums2)
    {
        unordered_set<int> m1(nums1.begin(), nums1.end());
        unordered_set<int> m3;

        for (auto e : nums2)
        {
            if (m1.find(e) != m1.end())
                m3.insert(e);
        }

        vector<int> v(m3.begin(), m3.end());

        return v;
    }
};